The problem is that you are delimiting the libpage with <>'s.  If you make it blank, then you'll end up with <> in the output.  I think you have to add some `if` statements somewhere.