fixed a missing / in base
added closing to script
fixed various bugs