Bugfix and simplify code