Fix for issue #37 & #38