Fix #184, #190, #194, #208 and #211