small bugfix and test