fixed and simplified linking, added missing shell profile, fixed exit/return codes