Fix various errors, getting ready to implement drawing