Fixed minor bugs; built entity test into index.php