Fixed Crashes

Signed-off-by: Pete McCarthy <petemccarthy@gmail.com>