Fixed small bug, removed test code