Off-by-one fix sent by Philipp Janda