fixed a few bugs in CPdb and assets plugin