Fix for #1010
Proper fix for #1010
Proper Fix for #992
Fix for #1009