Clean up and fix bugs in library/{glcd,console}.lua