Use 'pathto' to load static resource

Fixes #427