replacing hardcoded themedir to $themedir variable, fixing minor issues