Fix CLI library loading

Fixes #642