Added argument checking for binding of memory blocks. Solved problems with clean script