small bugfix and better compatibility