This looks like a bug. You're probably using Gazebo 2, which is no longer supported and won't receive bug fixes. I would try upgrading your Gazebo version and seeing if the issue persists.
if it persists, I would ticket an issue. It would also help if you included the file which is having problems.