Fix #139 and the issues that arose