Fixed crashes using .skip in view queries

Also added unit tests. Fixes #109