finally removed eval, added safety checks for unexpected type juggling