size optimization and similar fixes
size optimization and minor fixes