Fix for #84 and #63

Fix for #84 and #63