fixed issue with line numbers incrementing improperly

Signed-off-by: Anton Chan <antoniuschan99@gmail.com>