Fixed resource demand and multithreading issues.