fixed readLiteral and added test