Various bug fixes and still trying to get rendering working.