Bugs and style fixes.
Merge branch 'develop'