Keep resulting file within system length boundaries. Fixes #14