Update to application code

Fixed minor bugs in application code.