Fix #11
Might need more testing though