Bugfix and remove magic number.