Corrected return code, and created static library file