cleanup code
correct allocated size for run-time structures