Fix for #2 and #3

Fix for #2 and #3