Allow units change in the matprem list
Add some checks
Fix bugs