minor bug fixes

1. fixed an assumption that all columns of phi have the same l2 norm

2. fixed a bug that tried printing.