Attempt to solve #37. Needs to be tested on 1.6 though.