Fixed #239 and #236, removal of more unneeded stuff