Fixed up the awfully broken code I commited