Fixed bugs in embedding resources