Fixes for PR 1009
Merge remote-tracking branch 'hannestyden/pr-1009' into fix-align-parameters