Removed dead code
Added exception handling to the fem module