Fixed syntax errors & fixed library handling