NONE is not defined.

The string construction looks cumbersome - that can definitely be improved.