fixed debug print; fix link error