Fixed a bug that was probably causing some issues.