Cleaned out a few remaining bugs. Linted file and resolved critical problems.