Fixed #361 with some minor problems remaining