Function: Fixes str-slice behavior (#565)

Fixes #565.