Fixed issue with seg fault in decrypt function