Fixed timer code
Fixed a bunch of bugs