Skeletonize return type

Fixes issue #489 and some minor code improvements