Small fixes and fixed comments/formatting and moved showError method to main.js