Fixes CodeReview-Issues and adds tests