bugfix and adjust test