fixed some errors with rendering.