Fixed #467
Fixed #1137, #1142
Corrected scaling behaviour after maximum or minimum is reached
Merge pull request #1143 from dvvrd/fix467

Fixed #467, #1137, #1142