Fixes for issue 44 and 48