Fixed #281 #277 #275 #240