Fixed bugs #136, #116 & #155