Poposed fix for issue #450

This should fix #450 
Example:
http://plnkr.co/edit/r7iaAsIGO3j5VwjVux9k