Fixed a bug with rendering in library