Fixes for #297
Merge pull request #298 from kivy/fix-297

Fixes for #297