Some bug fixes and resource planing preliminary support