Added test sample and fixes for simulator