Fix for #151, #152 & #150