some changes and enhancements

I fixed some parts, made some enhancements and fixed some tabs. I did not test the scripts, so there might be some errors.