Add sharp/libvps as a dependency.
Add early type check for controller functions.
Use totalLength consistently.