So when the turrets fire aimlessly at least in my experience this is due to them locking in on an opponent and then losing sight of them thus they fire at that players most recently seen position. I don't know why or how this happens however it can be a bit useful despite it being a bug.
Some other bugs Heimerdinger has that I'm aware of are if he places a turret between a tower and an inhib the turret will attack the tower and afterwards refuse to attack the inhibitor but attack enemy champions minions etc. This is a bug as a freshly placed turret will hit the inhibitor. Another case with the inhibitors is if you let a turret deactivate then walk to it again to reactivate it it once again will not attack an inhib but otherwise performs as intended. These a bit of an issue when you're pushing. I'm unaware if either of these works with his ult.