bugfix and small changes