Testing and fixing code