Fixed class name resolution via ::class (#143,#129)

Fix targets issues #143 and #129