Added os source and fixed a compiler bug