Bugfix and readability improvement