Added more unit tests ; added Safe Pragma where possible