Hopefully resolve #11, add debugging to figure out what caused it