Fix stupid bug + remove test code