some more fixes and a json representation