Cleaned up a few buffer issues