Fixed some mistakes in tx/rx memory size handling