Fixed #22, #68, #70 and half of #58