Added additional boundary checks, fixes #81 .