Pak dependencies and better error handling